<!DOCTYPE html>
<html lang="ES">
<head>


<meta lang="ES" charset="UTF-8">

<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>


<title>Noticias de la Javeriana</title>
</head>
<body>
	<div id="news"></div>

	<script>
		//alert("Entro a publicar noticias");
		//$.ajaxSetup({ scriptCharset: "utf-8" , contentType: "application/json; charset=utf-8"});

		$.ajax({
			url : '#',
			success : function(result) {

				jQuery.ajaxSetup({
					scriptCharset : "utf-8",
					contentType : "application/json; charset=utf-8"
				});

				$.getJSON("http://localhost:8080/newspuj/extractnews",
						function(data) {
							$.each(data, function(i, item) {
							    if(item.imagen!=""){
							    	alert(item.imagen);
							    }
							    else{
							    	alert("No imagen");
							    }
								$("<p/>").html(item.titulo).appendTo("#news");
								if (i == 10)
									return false;
							});
						});

			} // edited
		});
	</script>

</body>
</html>